#!/usr/bin/env python

from nose.tools import assert_equal

# Import the module to test
from pillarbox.pillarboxapp.utils import set_type_from_string


class test_type_casting(object):

    def setup(self):
        pass


    def test_can_cast_an_int(self):
        expected = 4
        assert_equal(set_type_from_string('4'), expected)


    def test_can_cast_a_float(self):
        expected = 3.14159
        assert_equal(set_type_from_string('3.14159'), expected)


    def test_a_string_stays_a_string(self):
        expected = 'crafty fox'
        assert_equal(set_type_from_string('crafty fox'), expected)
